//
//  SHOptionalViewController.swift
//  RxSwiftDemo2019_03_31
//
//  Created by bebull on 2021/12/27.
//  Copyright © 2021 远平. All rights reserved.
//

import UIKit

class SHOptionalViewController: UIViewController, UIGestureRecognizerDelegate {
    
    lazy var demoTableView: UITableView = {
        let view = UITableView(frame: .zero, style: .plain)
        view.dataSource = self
        view.delegate = self
        view.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
        view.rowHeight = 80
        return view
    }()
    
    var texts: [String] = []
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .gray
//        print("navigationController: \(self.navigationController)")
//        navigationController?.interactivePopGestureRecognizer?.delegate = self
        
//        view.addSubview(demoTableView)
//        demoTableView.snp.makeConstraints { make in
//            make.edges.equalToSuperview()
//        }
//
//        for index in 0..<100 {
//            texts.append("这是第\(index)行")
//        }
    }
    

}

extension SHOptionalViewController: UITableViewDataSource, UITableViewDelegate {
    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
        cell.textLabel?.text = texts[indexPath.row]
        return cell
    }
    
    public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return texts.count
    }
    
}
